package com.aigc.txt2img.exception;

import com.fasterxml.jackson.databind.ser.Serializers;

public class BizException extends RuntimeException {

    private static final long serialVersionUID = 101L;

    protected int code;
    protected String msg;

    public BizException() {
        super();
    }

    public BizException(BaseException exp) {
        super(exp.getMessage());
        this.code = exp.getCode();
        this.msg = exp.getMessage();
    }

    public BizException(BaseException exp, Throwable cause) {
        super(exp.getMessage(), cause);
        this.code = exp.getCode();
        this.msg = exp.getMessage();
    }

    public BizException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public BizException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BizException(int code, String msg, Throwable cause) {
        super(msg, cause);
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}
